<template>异步组件：<CustForm ref="custForm" /></template>
<script lang="ts" setup>
import { defineAsyncComponent, ref } from 'vue';

// 在线表单动态组件的引用
const custForm = ref();
/**
 * 【在线表单组件实现入口】
 * 异步加载在线表单，并且继承 CustFormCommonUse 在线表单组件
 */
const CustForm = defineAsyncComponent({
  loader: () => {
    return new Promise((resolve, _reject) => {
      const onlineForm = {
        data() {
          return { test: 'hello' };
        },
        template: '<span> {{test}}:  <nut-input  v-model="test"  label="Input"  placeholder="请输入文本" /> </span>'
      };

      resolve(onlineForm as any);
    });
  }
});
</script>
